import React, { Component } from 'react'

export class Child extends Component {
  render () {
    const { salary, age, changeAge } = this.props
    return (
      <div>
        <p>工资：{salary}</p>
        <p>年龄：{age}</p>
        <p>年龄1：{this.props.obj.age}</p>
        <p>布尔：{typeof this.props.bBar}</p>
        <div>JSX: {this.props.jsxEle}</div>
        <button onClick={changeAge}>调用父组件里面的函数</button>
      </div>
    )
  }
}


//  function Child ({ salary, age }) {
//   return (
//     <div>
//       <p>工资：{salary}</p>
//       <p>年龄：{age}</p>
//     </div>
//   )
// }


export default Child
